package com.itheima.clientAndService01;

import java.util.ArrayList;
import java.util.stream.Stream;

public class ArgsClass08 {
    public static void main(String[] args) {
        ArrayList<String> manlist = new ArrayList<>();
        manlist.add("周杰伦");
        manlist.add("成龙");
        manlist.add("周星驰");
        manlist.add("张杰");
        manlist.add("王宝强");
        manlist.add("林俊杰");

        ArrayList<String> womenlist = new ArrayList<>();
        womenlist.add("杨幂");
        womenlist.add("刘涛");
        womenlist.add("杨丞琳");
        womenlist.add("杨紫");
        womenlist.add("林青霞");

        Stream<String> stream1 = manlist.stream().filter(name -> name.length() == 3).limit(2);
        Stream<String> stream2 = womenlist.stream().filter(name -> name.startsWith("杨")).skip(1);

        Stream.concat(stream1,stream2).forEach(s -> {
            Actor actor = new Actor(s);
            System.out.println(actor);
        });
    }
}
